Repository navigation
Conversation
- Added production terms to SST
- Added user-defined production limiter constant for TKE
- Updated boundary conditions as in TMR page
| nPrandtl_Lam, /*!< \brief Number of species | ||
| addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); Prandtl number. */ |
There was a problem hiding this comment.
Was this intentionally commented, or...? If it is used, I guess this should go to line 872
| nPrandtl_Lam, /*!< \brief Number of species | |
| addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); Prandtl number. */ | |
| nPrandtl_Lam, /*!< \brief Number of species laminar Prandtl number. */ | |
| addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); /*!<\brief Freestream mu_turb to mu_lam viscosity ratio */ |
There was a problem hiding this comment.
This is just a wrong copy-paste from me. It should not be there in the first place.
|
Great contribution, Thanks @rois1995 ! |
|
If you are looking into robustness aspects too you should get in touch with @emaberman and @YairMO, seems like they have some good ideas and between the free time of 3 people a lot more can get done :) |
|
Hi, Regarding the cross-diffusion term (CD) that appears in Omega source term (residual). The SST model (1994/2003) is a high-Reynolds-number model. Namely, It can not predict correctly the sub-layer region (especially the correct profile of the TKE). Therefore, only a positive contribution is required. Moreover, since the SST model was design as a k-w and k-epsilon blending, the CD term "belongs" only to the k-epsilon "branch", that is why the CD term include the factor "1-F1". However, it may happen, that the factor "1-F1" is not a 100% safe guarantee. It may happen that "1-F1" is not zero in region where the CD term is negative (this happen due numerical errors). To avoid such a situation, it is a good idea to clip the CD term with zero. Otherwise, severe numerical robustness issues may rise. |
- Given option for cross diffusion limiting in W residual
|
Hi, The use of an Omega production limiter (about the cross-diffusion term) is correct for low-Reynolds-number (LRN) models (the approach described by Peng et al. is very naive; there are other more rigorous treatments). For high-Reynolds-number (HRN) models, the clipping should be zero, keeping the cross-diffusion term positive; thus, the current implementation is correct. Indeed, it is not exactly as it appears in Menter's original publication. The factor (1-F1) aimed to promise that the cross-diffusion term will be activated only outside the boundary layer, where it is positive (the cross-diffusion term switches its sign deep inside the boundary layer). This was also recognized by Peng et al. (first paragraph above Eq. 17). However, it may happen that the factor (1-F1)=1 where the cross-diffusion term is negative. Usually, it may happen at the wake, very near the airfoil trailing edge, where the upper and lower boundary layers merge. It is due to the imperfection of the F1 function. To summarize, the current implementation is correct, and it is perfect for HRN models. |
|
For the sake of clarity, "current implementation" refers to the current treatment of the production code |
|
What YairMO is saying, is that allowing negative cross diffusion values is incorrect for high Reynolds models and should not be an option, this is a fix used for low Reynolds models only |
|
Hi @YairMO, Hi @emaberman , thank you very much for your comments. I haven't found any suggestion in literature to clip to only positive values the cross-diffusion term in the w-equation. I understand that it might be more robust, but it is not the standard implementation of the SST model, which is the first thing that we need to achieve. Only then we can build on top of that to improve the robustness of SU2. Nevertheless, I tried the SWBLI test case and I compared the results across 6 different combinations: 1- develop branch, no changes When my branch is used, then the changes to the supersonic inlet BC are already in place. I haven't achieved convergence with 1, 2 and 3. More precisely, 1 diverged right away (after 30 iterations), while 2 and 3 gave "FGMRES - Orthogonalization Failed" after 900ish iterations. Here you can see the residuals for the different combinations. Unfortunately I will be busy with the AIAA Conference next week, thus I don't know how much I will be able to work on this. The next test case will be the 2D airfoil near-wake from TMR. |
|
Hi rois1995, First of all, enjoy your time in Las Vegas. Any paper that you are presenting? As for our discussion about the cross-diffusion term, I've emailed the "source" (Menter). I believe he will make it clear. |
The standard (non-m) SST versions add 2/3 rho k to the normal stresses after the stress tensor of develop, which is otherwise unchanged; the overload of stressTensor with density and k is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…tes (#1851) As diagnosed in #1851, adding the free-stream k to the total energy of a boundary state gives the flow too much energy, because k decays right after the boundary (SST destruction): at inflows the static temperature is too high and the Mach number too low, most visibly at high Mach number and high turbulence intensity. Following the fix proposed there, read k from the turbulence solver at the boundary node in every flow boundary condition that builds a total energy: far field, inlet (total conditions and mass flow), supersonic inlet, Riemann (also removed from the static energy of the boundary state), outlet, engine inflow and exhaust, actuator disks. This replaces the previous choice of the free-stream or inlet k at inflows, which had the same problem; the shared GetInletTke is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Serial, parallel, hybrid, AD, tutorials and V&V SST tests. The values change because of the k of the boundary node in the boundary energy (#1851), the NASA TMR SST-sust free stream, the exact production of the standard versions, and UQ no longer counting 2/3 rho k twice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
|
Sorry for the long pause on this PR. I have brought it up to date with develop and reduced it to what its title says: aligning the SST implementation with the NASA TMR definitions.
The description is updated with the details. |
The reference values of rae2822_sst_sust, turb_naca0012_sst_restart_mg and bars_SST_2D, changed on both sides, are taken from develop for now and will be updated from the CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
It sets the far-field values of the NASA TMR, so the name says where they come from. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…ean up whitespace The 2/3 rho k term is selected inside SetStressTensor, so the callers are as in develop. Remove stray blank lines and extra spaces, and use beta_star in the omega Jacobian. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
SST cases change with the TMR alignment and the boundary k (#1851). The laminar, FSI and SA cases (poiseuille_profile, fsi_cht, pywrapper_unsteadyFSI, turb_naca0012_sa, turb_flatplate) move only in the last digits, from the rounding of the optimized build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
DENSITY_VELOCITY copies the total energy of the node, which already contains k, and k of the node was then added again to every Riemann case. The new test axi_rans_air_nozzle_density_velocity (air nozzle with a DENSITY_VELOCITY inlet and 20 % turbulence intensity) detects the double count in the inlet static temperature. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… selected The compressibility corrections were stored in SSTParsedOptions.production, the field of the production modifiers, so e.g. VORTICITY or KATO-LAUNDER together with COMPRESSIBILITY-WILCOX or -SARKAR silently lost the modified production. The corrections now use only their own flags (compWilcox, compSarkar), and both are applied and reported. Configurations with only one of the two options are unchanged (turb_flatplate_CC_Wilcox/Sarkar give the same values). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…uxes and axisymmetric sources With SST the total energy (and enthalpy) contains k: - ComputeConsistentExtrapolation and LowMachPrimitiveCorrection (non-ideal gas or low-Mach correction) rebuilt the face enthalpy without k. The k of the cells is now added, as the vectorized reconstruction does. Test: an SST flat plate with standard air and with a van der Waals gas of vanishing a, b (same physics, non-ideal code path) gave CD 0.6 % apart, now 0.04 % as with SA. - The speed of sound of Roe (vectorized and scalar), Turkel, general Roe, HLLC (ideal and general) and AUSM was computed from H including k. The (Roe-averaged) k is now removed from the enthalpy where the speed of sound or the thermodynamic state is computed; the energy flux keeps the total enthalpy. The solver passes the k of the cells (interior faces) and of the boundary node (boundary states). - Axisymmetric source: the pressure is recovered without rho k, the -2/3 rho k of the radial normal stress is outside the viscosity factor and only used where k is part of the stress tensor (standard SST versions), and SA no longer passes nu_tilde as k. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…cobians With k in the total energy, p = (gamma-1)(rho E - |rho u|^2/(2 rho) - rho k), so dp/drho contains -(gamma-1) k (general gas: -Kappa k) and the total enthalpy used in the energy row is gamma E - (gamma-1)(|u|^2/2 + k). GetInviscidProjJac (ideal and general gas) and the vectorized inviscidProjJac take k, which is passed by Roe (vectorized and scalar), Turkel, general Roe, JST/Lax (vectorized), AUSM and HLLC; the HLLC star Jacobians include it in dp/drho. The MUSCL sound-speed check also removes the Roe-averaged k from the enthalpy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
| */ | ||
| inline const CVariable* findTurbVars() { return nullptr; } | ||
| template<class T, class... Ts> | ||
| const CVariable* findTurbVars(T& first, Ts&... rest) { |
| */ | ||
| inline const CVariable* findTurbVars() { return nullptr; } | ||
| template<class T, class... Ts> | ||
| const CVariable* findTurbVars(T& first, Ts&... rest) { |
…k each MUSCL face's speed of sound - With k in the total energy, the energy components of the right eigenvectors contain |u|^2/2 + k (contact wave and, through the total enthalpy, acoustic waves), and the left eigenvectors use dp/drho = (gamma-1)(|u|^2/2 - k) (general gas: Chi + Kappa (|u|^2/2 - k)). Without it, a contact at rest with constant pressure and k was partly dissipated as acoustic waves. GetPMatrix / GetPMatrix_inv (ideal and general gas) and the vectorized pMatrix / pMatrixInv take k, passed by Roe (vectorized and scalar, L2Roe, LMRoe), MSW, JST-mat, AUSM, FVS, general Roe and the Riemann boundary conditions. - MUSCL: the speed of sound of each reconstructed side is checked too (HLLC takes the square root of each), not only the one of the Roe average. - Unit test roe_tke_tests: P P^-1 = I with k (2D and 3D), and no mass or energy flux across a stationary contact with constant pressure and k (the previous matrices gave 0.024 and 0.083 in the test). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…in the Riemann boundary states and Jacobians - Roe (scalar, general gas, SIMD) and JST-mat: the part rho_roe*Delta(k) of the jump of rho*E is not a pressure jump. Remove it before the projection with P^-1 and advect it with the contact eigenvalue (also in L2Roe, LMRoe and the explicit general-gas Roe, which build the wave strengths from the primitive jumps). - BC_TurboRiemann: subtract k from the boundary energy before the fluid model; the imposed total enthalpy is thermodynamic, as in BC_Riemann and BC_Inlet (k is added to the energy only). - BC_Riemann and BC_TurboRiemann: pass k to the flux Jacobian of the boundary state. - BC_Inlet (total conditions), BC_Engine_Exhaust, BC_ActDisk: the total speed of sound used the domain enthalpy with k against an imposed total enthalpy without k. - Unit test: contact with a jump of k (at rest and moving) gives the upwind flux for Roe, L2Roe, LMRoe, general Roe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…tream, fix omega at the SST turbo inlet - SLAU, SLAU2, AUSM: the speed of sound used E - |u|^2/2, which contains k with SST. Unit test ausm_tke_tests.cpp: with the same density, velocity and pressure the mass and momentum fluxes must not depend on k (27/27 checks fail without the fix). - SST: FREESTREAM_TURBULENCEINTENSITY = 0, FREESTREAM_TURB2LAMVISCRATIO = 0 or a zero free-stream velocity gave k = 0 or omega = 0 and mu_t = 0/0 (NaN at the first iteration). Stop with an error that names the options. - SST BC_Inlet_Turbo: omega was computed from the averaged solution k instead of the imposed k, so the imposed eddy-viscosity ratio was not the configured one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…M/SLAU Jacobians, declare k as a preaccumulation input - AUSM+up, AUSM+up2: the critical speed of sound used the total enthalpy with k (and so did its analytic derivative). - Accurate AUSM/SLAU Jacobians (USE_ACCURATE_FLUX_JACOBIANS): dp/drho and dH/drho with k held fixed. - Roe, general Roe, MSW, AUSM/SLAU: turb_ke is used in the flux, so it must be a preaccumulation input for the discrete adjoint (the SIMD schemes register it through gatherVariables). Found by the Codex review of 048b10a. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… in the SST wall function - SST has no BC_Engine_Inflow/Exhaust or BC_ActDisk: those faces got no turbulence flux at all (silent no-op). Stop with an error until a validated SST version exists. - SetTurbVars_WF wrote the current solution at the wall node, which is overwritten by the update. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…markers after the Euler zones are cleared - MSW: the speed of sound used H - |u|^2/2, which contains k with SST; the P matrices of the weighted states now use the weighted k. MSW added to the k-independence unit test (uniform k, 9 checks fail without the fix). - The SST marker check ran before Euler zones drop the turbulence model, so a multizone Euler zone with MARKER_ACTDISK was rejected. Found by the Codex review of b3ae2c7. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…of BC_Giles The interior static energy was E - |u|^2/2 (pressure too high by (gamma-1) rho k), and the boundary enthalpy had no k although the scheme is told that both states contain it. Found in a sweep of the sound speed and pressure recomputations for SST k (all other places already hold k fixed or out). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
|
As decided this morning, I've split this PR into two smaller PRs, to be merged in this order, after the mean-flow PRs #2942 to #2945:
Each of them has its own test cases. Closing this one. |
…) (#2946) ## Proposed Changes With SST, the compressible solver keeps the turbulent kinetic energy k inside the total energy. The equation of state takes it out before it computes the pressure: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/variables/CNSVariable.cpp#L145 The free-stream energy and about 15 boundary states add it. But the convective schemes never get k, only the viscous ones (and the axisymmetric source) do: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl#L477-L481 This PR makes every place use k in the same way. The fixes are grouped in six commits. - **Boundary energy (#1851).** The boundary states added a fixed k: the free-stream one (at the supersonic inlet, the one from the inlet settings). But k decays right away in the domain. The boundary then sees a jump of energy that is not a jump of pressure, and turns it into heat. At high Mach number and turbulence intensity, the inlet gets too hot and too slow. Far field and inlet, for example: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L5168-L5169 https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L7332-L7333 All flow boundary states now use the k of the boundary node. On the flat plate of #1851 (Mach 6.1, 800 K, Re 4.9e6 per m, wall at 300 K, turbulence intensity 5 %), the inlet had 837 K and Mach 5.96. With this PR it has 800.1 K and Mach 6.0995 (imposed: 800 K and 6.1). The test case, with plots and files, is in the comments. - **Convective schemes.** The speeds of sound, the eigenvectors (P and P^-1), the Jacobians and the Roe and JST-mat dissipation ignored k. For example, Roe: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/numerics/flow/convection/roe.cpp#L148-L149 So a contact at rest with a jump of k (same pressure and velocity) produced a mass and an energy flux. Now k is out of the speed of sound, and the jump of energy due to k moves with the flow, like a contact. This covers the classic and the vectorized schemes: Roe family, JST-mat, HLLC, AUSM family, SLAU and MSW. k is also added to the preaccumulation inputs. With MUSCL, only the Roe average of the two face states had its speed of sound checked: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L1979 Each face state is now checked too (HLLC, for example, uses both). - **Riemann, turbomachinery Riemann and Giles boundaries.** The Riemann eigenvectors and Jacobians used k = 0, and the total enthalpy of the Giles boundary state had no k. The static energy of the interior state still contained k: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L5310-L5311 The inlet, engine exhaust and actuator disk computed the total speed of sound from the total enthalpy of the node, which contains k: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CEulerSolver.cpp#L7276 All of these now account for k. The Riemann DENSITY_VELOCITY inlet takes its energy from the node, so it now removes k first and adds it back like the other cases. A new regression test covers it. The mixed-out average used by Giles also counted k as heat. It now removes it. - **Axisymmetric source.** The pressure was computed without removing k: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/numerics/flow/flow_sources.cpp#L77 The viscous part also had a term with k in the energy equation: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/numerics/flow/flow_sources.cpp#L182-L184 This term does not come from the stress tensor of the solver, and its units are wrong (it adds rho k to velocity gradients). With SA, it used nu~ as if it were k. It is removed, and k is now set only with SST. - **SST_OPTIONS.** A compressibility correction (COMPRESSIBILITY-WILCOX or -SARKAR) was stored in the same place as the production modifier. So it replaced VORTICITY, KATO-LAUNDER or UQ when both were set: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/Common/include/option_structure.hpp#L1203-L1210 The corrections now have their own flags and work with the modifiers. No regression test uses both options together. - **Turbomachinery inlet.** SST computed omega from the average k of the flow solver, not from the imposed k: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CTurbSSTSolver.cpp#L780-L788 - **New configuration errors.** SST with engine or actuator-disk markers now stops. SST has no boundary condition for them (only SA has one), so these faces got no turbulence flux at all: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/include/solvers/CSolver.hpp#L1269-L1274 A zero intensity, viscosity ratio or velocity gives zero k or omega. This now stops the run, but only when the free-stream values are used. They are used by a new run, a far field, an inlet profile file, `TURB_FIXED_VALUES` and the DLL limits. Before, it gave mu_t = 0/0 in the whole field: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CTurbSSTSolver.cpp#L124-L125 SST with a non-ideal gas also stops with JST_MAT or with Turkel / low-Mach preconditioning. These parts compute rho k with the ideal-gas formula. - **SST wall function.** The new k and omega went to the wall node, not to the node next to the wall that the model is for. The value written for that node was lost in the next iteration. Now the wall function writes the solution of the node next to the wall: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/solvers/CTurbSSTSolver.cpp#L582-L583 New tests: - Unit tests `roe_tke_tests.cpp` and `ausm_tke_tests.cpp`: a jump of k in the Roe, AUSM-type and MSW schemes; the vectorized P, P^-1 and Jacobian with k (checked against finite differences). - `sst_energy_tests.cpp`: vectorized JST_MAT and MSW with a jump of k (MSW compared with the non-vectorized version). - k in `hllc_jacobian_tests.cpp`. - Regression tests `air_nozzle_density_velocity.cfg` (Riemann DENSITY_VELOCITY inlet with SST) and `turb_SST_JST_MAT_RAE2822.cfg` (SST with JST_MAT, MPI). Reference values: almost all SST tests change, mostly because of the boundary energy. Restart cases change the most: their solutions were converged with the old boundary k. Some non-SST tests change too: - Roe and MUSCL cases change slightly, because of the new check of each face state. - Implicit JST cases change, because the scalar dissipation Jacobian had twice the correct dp/drho term in the energy row (`(gamma-1)|u|^2` instead of `(gamma-1)|u|^2/2`). - A few SA and Euler tests also change a little (`aachen_turbine_restart`, `turbmod_sa_neg_rae2822`, `uniform_flow`, `turb_naca0012_sa`, tutorial `unsteady_naca0012`). The code on their path gives the same values, but SU2 is built with `-ffast-math`, so the compiler rounds the changed functions differently. These cases are sensitive: their aarch64 values differ from x86 by a similar amount. The static-pressure outlets from #2975 now also hold the k of the node fixed and keep it out of the EOS energy, like the other Riemann kinds here. The new values come from the CI. Not changed here: the general-gas axisymmetric source and the energy check of the under-relaxation factor still ignore k. The wall Jacobians (isothermal, heat flux, moving wall) do not hold k fixed in dT/drho. This matters only when the wall k is not zero (wall functions, rough walls). The stress tensor still has no 2/3 rho k: https://github.com/su2code/SU2/blob/a6b7496b740ac0e63807ee1b066a4badd902da91/SU2_CFD/src/numerics/flow/flow_diffusion.cpp#L141 That term, and the standard SST versions, come in the next PR (alignment with NASA TMR). It is the bug-fix half of #2329. ## Related Work - Fixes #1851. - #2329 (split: the alignment with NASA TMR follows in a separate PR). - #2942-#2945 (mean-flow fixes, merged). ## PR Checklist - [x] I am submitting my contribution to the develop branch. - [x] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson). - [x] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/). - [x] I used the pre-commit hook to prevent dirty commits and used `pre-commit run --all` to format old commits. - [x] I have added a test case that demonstrates my contribution, if necessary. - [x] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: rois1995 <rauxa1995@gmail.com> Co-authored-by: Josh Kelly <81244680+joshkellyjak@users.noreply.github.com>


Proposed Changes
This PR aligns the SST implementation with the definitions of the NASA Turbulence Modeling Resource (TMR, SST page) and Menter's papers, and fixes the turbulent kinetic energy imposed at the flow boundaries (#1851). The default (modified, "m") versions keep their interior formulation; results change mainly because of the boundary fix.
1. SST versions as defined by TMR
V1994m,V2003m, the default): TMR defines them as ignoring ⅔ρk in the stress tensor and using the production P = μ_t·S². This is what develop already does; unchanged.V1994,V2003): they were disabled in develop. They now include ⅔ρk in the stress tensor (momentum and energy, scalar and SIMD viscous fluxes) and use the exact production (including −⅔ρk·div u and −⅔μ_t·(div u)²), as TMR's standard SST.2. Model details
CTurbSSTVariable.cpp). The values happened to be right (20 → 1e-20 for SST-1994, 10 → 1e-10 for SST-2003) but were tied to the production limiter. Now the fixed values of each version (Menter 1994 eq. A10; TMR "uses 10⁻¹⁰ rather than 10⁻²⁰" for 2003).REYNOLDS_LENGTH; new optionsSST_SUST_TKE_AMBandSST_SUST_OMEGA_AMBoverride them.3. Boundary energy (#1851)
The flow boundary conditions built the boundary total energy with the free-stream k (
Energy += GetTke_Inf()), while the turbulence k at the boundary nodes decays immediately (SST destruction). The flow then received too much energy: the static temperature at inlets was too high and the Mach number too low, especially at high Mach number and turbulence intensity. As proposed in #1851, all flow boundary states that include k (far field, inlet, supersonic inlet, Riemann, outlet, engine, actuator disk) now use the k of the boundary node from the turbulence solver.Reproduced at the conditions of #1851 (flat plate, M = 6.1, T = 800 K, Re = 4.9·10⁶ 1/m, T_wall = 300 K, Tu = 5 %): inlet temperature 841 K and Mach 5.95 with develop, 793 K and 6.12 with this PR (imposed: 800 K, 6.1).
4. Consistency of k in the flow solver
The k in the total energy was only partly consistent in
develop. Four reviews (own, Kilo, Codex, and a turbulence/mean-flow review) found the following places, all fixed here.roe_tke_tests.cpp). Without it Roe dissipated a contact at rest (mass flux 0.0235 and energy flux 0.083 in the unit test). The MUSCL check of the sound speed is done per side. A jump of k is treated as a contact, not as a pressure jump.SST_OPTIONS: a compressibility correction overwrote the selected version and the Kato-Launder option (bug of develop).Known open point: for the non-modified versions the primal stress gains −⅔ρk, but the continuous-adjoint interior viscous operator has no matching term. Either the terms are added, or the combination is rejected; to be decided.
5. Options and documentation
SST_OPTIONS:V1994andV2003enabled;TMRBC(far-field and inlet ω = 10·U/L_DOMAIN, the original far-field prescription reported by TMR);WALL_OMEGA_LIMIT(clips the ω wall value 60ν/(β₁d²) to the upper limit of ω; off by default).config_template.cfg: the SST versions, the new options, and the TMR range for the far-field μ_t/μ (10⁻⁵ to 10⁻², next toFREESTREAM_TURB2LAMVISCRATIO; the default of 10 is unchanged).Test cases
Reference values updated for the SST tests (serial, parallel, hybrid, AD, tutorials, V&V). The new unit test
roe_tke_tests.cppcovers the eigenvector matrices with k. Most changes come from the boundary fix; restart cases change most because their solutions were converged with the old boundary k; SST-sust cases change because of the TMR ambient values. A few values could not be reproduced on my machine even with develop, and three tests changed on both sides in the last merge of develop (rae2822_sst_sust,turb_naca0012_sst_restart_mg,bars_SST_2D); these will be taken from the CI logs.Related Work
hllc.cpp,roe.cppand the MUSCL block ofCEulerSolver::Upwind_Residual; the PR merged second resolves a small conflict.PR Checklist
pre-commit run --allto format old commits.🤖 Generated with Claude Code